﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="frmOrderDetail.aspx.cs" Inherits="BSPortal.Usercontrol.Admin.Book.Order.frmOrderDetail" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit, Version=3.5.40412.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link href="/CSS/Style.css" rel="stylesheet" type="text/css" />
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <telerik:RadWindowManager ID="RadWindowManager2" runat="server" 
    Skin="Outlook">
 </telerik:RadWindowManager>
 <asp:ToolkitScriptManager ID="toolKitScriptManager" runat="server">
 </asp:ToolkitScriptManager>
    <style type="text/css">      
        .bigModuleBottom td{padding:0}
        .style1
        {            text-align: left;
        }
        .style2
        {
            
        }
        .style3
        {            text-align: center;
        }
    </style>
    <script type="text/javascript">        
        function GetRadWindow() {
             var oWindow = null;
             if (window.radWindow)
                 oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog      
             else if (window.frameElement.radWindow)
                 oWindow = window.frameElement.radWindow; //IE (and Moz as well)      
             return oWindow;
         }
        
        function OnClientcloseDetail(sender, eventArgs) {
            var arg = eventArgs.get_argument();
            if (arg != null && arg.Modified == 'true')
                document.getElementById('btnReLoad').click();
        }

        function CloseDetail() {
             var arg = new Object();
             arg.Modified = document.getElementById('<%=hdModifiedInfo.ClientID %>').value;
             GetRadWindow().Close(arg);
         }
        </script>

        </div>
        <div>
            <asp:UpdatePanel runat="server" ID="updatePanel2" RenderMode="Inline" UpdateMode="Conditional">
        <ContentTemplate>
                                    <div class="ListAccountTitle">
                        <h2>Thông tin chung</h2></div> 
        <div align="center">
            <asp:Panel ID="Panel1" DefaultButton="btnSave" runat="server">
              <table width="100%" align="center" style="border-style: double; border-width: 3px; padding: 1px 4px" >
                    <tr>
                        <td align="left" class="style1">
                            ID:
                        </td>
                        <td align="right" class="style2">
                            <asp:TextBox ID="txtId" runat="server" Width="200px" Enabled="False"></asp:TextBox>
                        </td>
                        <td align="left" class="style3">
                            Tỉnh/Thành:</td>
                        <td align="right">
                            <asp:DropDownList ID="ddlCity" runat="server" AutoPostBack="True" 
                                onselectedindexchanged="ddlCity_SelectedIndexChanged" Width="200px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="style1">
                            Phí:</td>
                        <td align="right" class="style2">
                            <asp:TextBox ID="txtFee" runat="server" Width="200px"></asp:TextBox>
                        </td>
                        <td align="left" class="style3">
                            Quận/Huyện:
                        </td>
                        <td align="right">
                            <asp:DropDownList ID="ddlDistrict" runat="server" AutoPostBack="True" 
                                onselectedindexchanged="ddlDistrict_SelectedIndexChanged" Width="200px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="style1">
                            Trạng thái:
                        </td>
                        <td align="right" class="style2">
                            <asp:DropDownList ID="ddlStatus" runat="server" Width="200px">
                                <asp:ListItem Value="0">Chưa xử lý</asp:ListItem>
                                <asp:ListItem Value="1">Đã xử lý</asp:ListItem>
                                <asp:ListItem Value="2">Hủy</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                        <td align="left" class="style3">
                            Xã/Phường:</td>
                        <td align="right">
                            <asp:DropDownList ID="ddlWard" runat="server" Width="200px">
                            </asp:DropDownList>    
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="style1">
                            Số ĐT:</td>
                        <td align="right" class="style2">
                            <asp:TextBox ID="txtPhone" runat="server" Width="200px"></asp:TextBox>
                        </td>
                        <td align="left" class="style3">
                            Số đường</td>
                        <td align="right">
                            <asp:TextBox ID="txtAddress" runat="server" Width="200px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" class="style1">
                            Ghi Chú:</td>
                        <td align="right" class="style2">
                            <asp:TextBox ID="txtNote" runat="server" Height="100px" TextMode="MultiLine" 
                                Width="100%"></asp:TextBox>
                        </td>
                        <td align="left" class="style3">
                            Thanh toán</td>
                        <td align="right">
                            <asp:TextBox ID="txtPayType" runat="server" Width="200px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="left" colspan="4">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td style="height: 20px;" align="center" colspan="4">
                            <strong>
                                <asp:Label ID="lblStatus" runat="server" CssClass="sm_error"></asp:Label>
                            </strong>
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="4">
                            <asp:Button ID="btnSave" runat="server" CssClass="Submit" Text="Lưu" ValidationGroup="ProductPriceNews"
                                OnClick="btnSaveInfo_Click" />&nbsp;
                            <asp:Button ID="btnReset" CssClass="Submit" runat="server" Text="Nhập lại" OnClick="btnResetInfo_Click" />&nbsp;
                            <asp:Button ID="btnCancel" CssClass="Submit" runat="server" Text="Đóng" OnClientClick="CloseDetail()" />
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="4">
                            <br />
                            <asp:UpdateProgress ID="UpdateProgress2" runat="server" DisplayAfter="10" DynamicLayout="false">
                                <ProgressTemplate>
                                    <span>
                                        <asp:Image alt="" ID="imgLoading" ImageUrl="~/images/loader2.gif" runat="server" /></span>
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                        </td>
                    </tr>
                </table>
                
                
                <asp:HiddenField ID="hdModifiedInfo" runat="server" />
            </asp:Panel>
       </div>
        </ContentTemplate>
    </asp:UpdatePanel>
        </div>
        
        <div>
     
<asp:UpdatePanel runat="server" ID="udpSelectMethod" RenderMode="Inline" UpdateMode="Conditional">
    <ContentTemplate>          
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="left" style="width:50%;">
                    <div class="ListAccountTitle">
                        <h2>Chi tiết đơn đặt hàng</h2></div>                        
                </td>
                <td align="right">
                <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="udpSelectMethod"
                    DynamicLayout="true" DisplayAfter="10">
                    <ProgressTemplate>
                        <span class="LoadingStatus"><asp:Image ID="Image1" runat="server" ImageUrl="~/Images/loader_green.gif" />Loading.....</span>
                    </ProgressTemplate>
                </asp:UpdateProgress>
                </td>               
            </tr>
            <tr>
                 <td align="left"  valign="middle"  >                     
                     <asp:ImageButton ID="imgAdd" runat="server" ImageUrl="~/Images/AddRecord.gif" 
                         onclick="imgAdd_Click" /><a onclick="document.getElementById('<%=hdId.ClientID %>').value=''; document.getElementById('<%=imgAdd.ClientID %>').click();" >&nbsp;Thêm chi tiết</a>                    
                     <asp:HiddenField ID="hdId" runat="server" />                     
                 </td>   
                 <td align="right"  valign="middle">
                    <asp:ImageButton ID="btnReLoad" Width="18px" Height="18px" runat="server" ImageUrl="~/Images/load.png" 
                         onclick="btnReLoad_Click" />
                 </td>             
                 
            </tr>
            <tr>
                 <td colspan="2" valign="top" align="center">                        
                    <telerik:RadGrid ID="RadGrid" runat="server" AllowPaging="True" GridLines="None" Skin="Outlook"  AllowAutomaticDeletes="True"                         
                        onpageindexchanged="RadGrid_PageIndexChanged" onneeddatasource="RadGrid_NeedDataSource" onitemdatabound="RadGrid_ItemDataBound" 
                            AllowCustomPaging="true" ShowStatusBar="true" >                           
                            <MasterTableView AutoGenerateColumns="False" datakeynames="OrderDetailId" NoMasterRecordsText="Không tìm thấy dữ liệu.">
                                <Columns>
                                    <telerik:GridTemplateColumn DataType="System.Int32" HeaderText="STT" 
                                        UniqueName="STT">
                                        <ItemTemplate>
                                            <asp:Label ID="lblSTT" runat="server" ></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="5%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="OrderDetailId" HeaderText="ID" 
                                        UniqueName="OrderDetailId" >                                        
                                        <ItemTemplate>
                                            <asp:Label ID="lblOrderDetailId" runat="server" Text='<%#Eval("OrderDetailId") %>'></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="10%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="OrderId" HeaderText="OrderId" 
                                        UniqueName="OrderId" >                                        
                                        <ItemTemplate>
                                            <asp:Label ID="lblOrderId" runat="server" Text='<%# Eval("OrderId") %>'></asp:Label>
                                        </ItemTemplate>  
                                        <HeaderStyle Width="10%" />  
                                        <ItemStyle HorizontalAlign="Center" />                                 
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="ProductName" HeaderText="Tên"
                                        UniqueName="ProductName">
                                        <ItemTemplate>
                                            <asp:Label ID="lbProductName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
                                        </ItemTemplate>  
                                        <HeaderStyle Width="10%" />       
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>  
                                    <telerik:GridTemplateColumn DataField="Amount" HeaderText="Số lượng"
                                        UniqueName="Amount">
                                        <ItemTemplate>
                                            <asp:Label ID="lbAmount" runat="server" Text='<%# Eval("Amount") %>'></asp:Label>
                                        </ItemTemplate>  
                                        <HeaderStyle Width="10%" />       
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>                     
                                    <telerik:GridTemplateColumn UniqueName="Update">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgUpdateDetail"  runat="server" 
                                                ImageUrl="~/Images/edit.gif" ToolTip="Sửa" onclick="imgUpdate_Click"/>
                                        </ItemTemplate>
                                        <HeaderStyle Width="5%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn UniqueName="Delete">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="imgDeleteDetail"  runat="server" 
                                                ImageUrl="~/Images/delete.gif" ToolTip="Xóa" onclick="imgDelete_Click"/>
                                        </ItemTemplate>
                                        <HeaderStyle Width="5%" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                </Columns>                                                                                
                            </MasterTableView>
                            <ItemStyle HorizontalAlign="Center"/>
                            <HeaderStyle Font-Bold="True" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
                                VerticalAlign="Middle" Wrap="True" />
                            <clientsettings EnableRowHoverStyle="true">
                                <selecting allowrowselect="True" />                                                                                
                            </clientsettings>  
                        </telerik:RadGrid>
                 </td>
            </tr>
        </table>
        <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="False"  ReloadOnShow="True" runat="server" Skin="Outlook" EnableShadow="true" 
            VisibleStatusbar="false" VisibleOnPageLoad="false" Behaviors="Close,None" DestroyOnClose="true" EnableViewState = "false">
            <Windows>
                <telerik:RadWindow ID="frmProductPriceNews" runat="server" Modal="True" Width="400px" OnClientClose="OnClientcloseDetail" >
                </telerik:RadWindow>
            </Windows>
    </telerik:RadWindowManager> 
    <asp:HiddenField  ID="hdModified" runat="server" />   
    </ContentTemplate>
</asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
